export interface RequestData {
  s_time: string
  e_time: string
  event_name?: string | null  // 赛事名称，可选参数用于筛选
}

export interface SignalCondition {
  fid: number
  company_id: number
}

export interface Matches {
  event_name: string
  fid: number
  homesxname: string
  awaysxname: string
  matchtime: string
  homescore: number
  awayscore: number
}

export interface Signal {
  fid: number
  odds_time: string
  home_odds: number
  draw_odds: number
  away_odds: number
  prob_home_odds: number
  prob_draw_odds: number
  prob_away_odds: number
  return_rate: number
  home_kelly: number
  draw_kelly: number
  away_kelly: number
  market_home: number
  market_draw: number
  market_away: number
  market_total: number
  guiyi_home: number
  guiyi_draw: number
  guiyi_away: number
  rezhi_home: number
  rezhi_draw: number
  rezhi_away: number
  signal_home: number
  signal_draw: number
  signal_away: number
}

export interface LoginRequestData {
  username: string
  password: string
  code: string
}

export type SignalResponseData = ApiResponseData<Signal[]>
export type MatchesResponseData = ApiResponseData<Matches[]>

// 赛事列表相关类型
export interface EventList {
  event_name: string | null
}

export type EventListResponseData = ApiResponseData<EventList[]>

// 相似比赛相关类型
export interface SimilarMatches {
  event_name: string | null
  order_num: string | null
  fid: number | null
  matchtime: string | null  // ISO字符串格式的日期时间
  homesxname: string | null
  awaysxname: string | null
  homescore: number | null
  awayscore: number | null
  home_initial: number | null
  draw_initial: number | null
  away_initial: number | null
  home_final: number | null
  draw_final: number | null
  away_final: number | null
  signal_home_initial: number | null
  signal_draw_initial: number | null
  signal_away_initial: number | null
  signal_home_final: number | null
  signal_draw_final: number | null
  signal_away_final: number | null
}

export interface SimilarMatchesCondition {
  current_page?: number  // 当前页码，默认第1页
  page_size?: number     // 每页大小，默认20条
  event_name?: string | null  // 赛事名称，可选参数
  home_initial_min: number  // 主队初始赔率最小值
  home_initial_max: number  // 主队初始赔率最大值
  draw_initial_min: number  // 平局初始赔率最小值
  draw_initial_max: number  // 平局初始赔率最大值
  away_initial_min: number  // 客队初始赔率最小值
  away_initial_max: number  // 客队初始赔率最大值
  signal_home_initial_min: number  // 主队初始信号最小值
  signal_home_initial_max: number  // 主队初始信号最大值
  signal_draw_initial_min: number  // 平局初始信号最小值
  signal_draw_initial_max: number  // 平局初始信号最大值
  signal_away_initial_min: number  // 客队初始信号最小值
  signal_away_initial_max: number  // 客队初始信号最大值
}

export interface PaginationInfo {
  current_page: number  // 当前页码
  page_size: number     // 每页大小
  total: number         // 总记录数
  total_pages: number   // 总页数
}

export interface MatchStatistics {
  total_matches: number
  home_wins: number
  draws: number
  away_wins: number
  home_win_rate: number
  draw_rate: number
  away_win_rate: number
}

export type SimilarMatchesResponseData = {
  code: number
  message: string
  data: SimilarMatches[]
  pagination: PaginationInfo
  statistics: MatchStatistics | null
}
